package com.demo1;

public class Test {
    public static void main(String[] args) {
        //创建对象
        Frog frog = new Frog("小青",1);
        System.out.println(frog.getName()+","+frog.getAge());
        frog.eat();
        frog.swim();
        System.out.println("=========");
        Dog dog = new Dog("旺财", 5);
        System.out.println(dog.getName()+","+dog.getAge());
        dog.eat();
        dog.swim();
        System.out.println("=========");
        Rabbit rabbit = new Rabbit("小白", 2);
        System.out.println(rabbit.getName()+","+rabbit.getAge());
        rabbit.eat();
    }
}
